<div class="fullscreen" nz-row>
    <div class="outer-panel" nz-col nzSpan="10">
        <div class="inner-panel">
            <div class="abc" style="padding: 10px 10px 0 10px">
                <button (click)="addModule()" *ngIf="showAddModule" nz-button nzType="primary">
                    <i nz-icon nzType="plus"
                       theme="outline"></i>新增目录
                </button>
                <button (click)="addCode()" *ngIf="showAddCode" nz-button
                        nzType="primary">
                    <i
                        [nzType]="'plus'" nz-icon
                        theme="outline"></i>新增字典
                </button>
                <button (click)="reload(); " *ngIf="showRefresh" nz-button nzType="primary">
                    <i nz-icon nzType="reload"
                       theme="outline"></i>刷新
                </button>
            </div>
            <div class="category-tree-container">
                <base-tree
                    #baseTree
                    (selectNode)="selectNode($event)"
                    [beforeDrop]="beforeDrop.bind(this)"
                    [draggable]="true"
                    [globalName]="'字典模块'"
                    [showRoot]="true"
                    [showSearch]="false"
                    [treeNodeTemplate]="treeNodeTemplate"
                ></base-tree>
            </div>
            <ng-template #treeNodeTemplate let-node>
                <span [attr.aria-grabbed]="baseTree.draggable && !node.isDisabled ? true : null"
                      [attr.draggable]="baseTree.draggable && !node.isDisabled ? true : null"
                      [class.active]="activatedCategory?.id === node.key"
                      [class.draggable]="baseTree.draggable && !node.isDisabled ? true : null"
                      class="tree-node"
                      style="display: inline-block;"
                >
                    <span *ngIf="node.origin.type === 'root'">
                       <i nz-icon nzType="dr:hy-root" theme="fill"></i>
                    </span>
                    <span *ngIf="node.origin.type === 'module'">
                       <i nz-icon nzType="dr:hy-module" theme="fill"></i>
                    </span>
                    <span *ngIf="node.origin.type === 'leaf'">
                       <i nz-icon nzType="dr:hy-terminal" theme="fill"></i>
                    </span>
                    <span class="title-name">{{ node.title }}
                        <span *ngIf="node.origin.data.type==='leaf'"
                              class="title-code">{{'【' + node.origin.data.code + '】'}}</span>
                    </span>

                    <ng-container *ngIf="node.origin.type !== 'root'">
                        <span (click)="modifyClick($event, node.origin)" class="hover-icon">
                           <i nz-icon nzType="edit" theme="fill" title="修改"
                           ></i>
                        </span>
                        <span (nzOnConfirm)="deleteClick(node.origin)"
                              [title]="'删除'"
                              class="hover-icon"
                              nz-popconfirm
                              nzCancelText="取消"
                              nzOkText="确认"
                              nzTitle="是否删除?"><i nz-icon nzType="delete"
                                                                          theme="outline"></i>
                    </span>
                    </ng-container>
                </span>
            </ng-template>
        </div>
    </div>
    <div *ngIf="!showAddCode" class="outer-panel" nz-col nzSpan="14">
        <div class="inner-panel">
            <sys-code [selectedModule]="activatedCategory"></sys-code>
        </div>
    </div>
</div>
<!--[commitWrapper]="commitWrapper"-->
<!--[recordWrapper]="recordWrapper"-->
<ng-container *ngIf="_showDetailPanel">
    <base-detail
        (eventClose)="detailClose($event)"
        [baseParam]="baseParam"
        [detailPanelType]="detailPanelType"
        [height]="400"
        [name]="'字典模块'"
        [record]="detailRecord"
        [schema]="schema"
        [usePopup]="true"
        [width]="650"
    >
    </base-detail>
</ng-container>
